/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.shop.user.api.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 商城优惠券
 *
 * @author pigx code generator
 * @date 2023-12-03 12:01:37
 */
@Data
@TableName("shop_coupon")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商城优惠券")
public class ShopCoupon extends Model<ShopCoupon> {

	private static final long serialVersionUID = 1L;

	/**
	 * 优惠券ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description = "优惠券ID")
	private Long id;

	/**
	 * 优惠券口令
	 */
	@Schema(description = "优惠券口令")
	private String couponCode;

	/**
	 * 优惠券名称
	 */
	@Schema(description = "优惠券名称")
	private String couponName;

	/**
	 * 订单金额 (满减金额)
	 */
	@Schema(description = "订单金额 (满减金额)")
	private Integer orderPrice;

	/**
	 * 优惠券类型 1: 代金券 2: 折扣券
	 */
	@Schema(description = "优惠券类型 1: 代金券 2: 折扣券")
	private String couponType;

	/**
	 * 优惠券种类 1: 用户领取 2: 系统发放 3: 付费卷 4: 新人卷
	 */
	@Schema(description = "优惠券种类 1: 用户领取 2: 系统发放 3: 付费卷 4: 新人卷")
	private String couponCate;

	/**
	 * 折扣率
	 */
	@Schema(description = "折扣率")
	private Integer discountRate;

	/**
	 * 减免金额
	 */
	@Schema(description = "减免金额")
	private Integer deductionPrice;

	/**
	 * 到期类型 1: 领券后生效 2: 固定时间段
	 */
	@Schema(description = "到期类型 1: 领券后生效 2: 固定时间段")
	private String expirationType;

	/**
	 * 有效天数
	 */
	@Schema(description = "有效天数")
	private Integer effectiveDays;

	/**
	 * 有效开始时间
	 */
	@Schema(description = "有效开始时间")
	private LocalDateTime effectiveStartDate;

	/**
	 * 有效结束时间
	 */
	@Schema(description = "有效结束时间")
	private LocalDateTime effectiveEndDate;

	/**
	 * 是否启用 1: 启用 0: 关闭
	 */
	@Schema(description = "是否启用 1: 启用 0: 关闭")
	private String status;

	/**
	 * 优惠券适用商品范围 1: 全部商品 2: 部分商品
	 */
	@Schema(description = "优惠券适用商品范围 1: 全部商品 2: 部分商品")
	private String useGoodsType;

	/**
	 * 排序
	 */
	@Schema(description = "排序")
	private Integer orderBy;

	/**
	 * 积分
	 */
	@Schema(description = "积分")
	private Integer point;

	/**
	 * 排序
	 */
	@Schema(description = "备注")
	private String remark;

	/**
	 * 删除标记
	 */
	@TableLogic
	@Schema(description = "删除标记")
	private String delFlag;

	/**
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建人")
	private String createBy;

	/**
	 * 修改人
	 */
	@TableField(fill = FieldFill.UPDATE)
	@Schema(description = "修改人")
	private String updateBy;

	/**
	 * 创建时间
	 */
	@Schema(description = "创建时间")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	/**
	 * 修改时间
	 */
	@Schema(description = "修改时间")
	@TableField(fill = FieldFill.UPDATE)
	private LocalDateTime updateTime;

}
